package views;

import views.panels.PanelGeneral;
import logicBusiness.EstudianteBL;
import models.Estudiante;
import java.awt.BorderLayout;
import java.util.List;

/**
 *
 * @author vanessa
 */
public class InterfazReporteMatricula extends javax.swing.JFrame {

    EstudianteBL estudiantebo;

    private void inicializarTablaDeReporteMatricula() {
//        List<Estudiante> listaPreinscritos = estudiantebo.obtenerListadoMatriculados();
//        int numfilas = listaPreinscritos.size();

//        TEstuMatricul.setModel(new javax.swing.table.DefaultTableModel(
////                new Object[numfilas][2],
//                new String[]{
//                    "Apellido", "Nombre"
//                }) {
//
//            boolean[] canEdit = new boolean[]{
//                false, false
//            };
//
//            @Override
//            public boolean isCellEditable(int rowIndex, int columnIndex) {
//                return canEdit[columnIndex];
//            }
//        });


//        for (int indicefilas = 0; indicefilas < numfilas; indicefilas++) {
////            this.TEstuMatricul.setValueAt(listaPreinscritos.get(indicefilas).getApellidoEst(), indicefilas, 0);
////            this.TEstuMatricul.setValueAt(listaPreinscritos.get(indicefilas).getNombreEst(), indicefilas, 1);
//        }
//
    }

    /** Creates new form InterfazReporteMatricula */
    public InterfazReporteMatricula() {
        initComponents();
        PanelGeneral panel = new PanelGeneral();
        this.add(panel, BorderLayout.SOUTH);
        estudiantebo = new EstudianteBL();
        this.inicializarTablaDeReporteMatricula();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        CPEstudiantesMatric = new javax.swing.JScrollPane();
        TEstuMatricul = new javax.swing.JTable();
        BAceptar = new javax.swing.JButton();

        setResizable(false);

        jLabel1.setText("Estudiantes Matriculados:");

        TEstuMatricul.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Apellido", "Nombre"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        TEstuMatricul.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_ALL_COLUMNS);
        CPEstudiantesMatric.setViewportView(TEstuMatricul);
        TEstuMatricul.getColumnModel().getColumn(0).setPreferredWidth(170);
        TEstuMatricul.getColumnModel().getColumn(1).setPreferredWidth(300);

        BAceptar.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        BAceptar.setText("Aceptar");
        BAceptar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BAceptarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel1))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(CPEstudiantesMatric, javax.swing.GroupLayout.DEFAULT_SIZE, 476, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(150, 150, 150)
                        .addComponent(BAceptar, javax.swing.GroupLayout.PREFERRED_SIZE, 175, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(CPEstudiantesMatric, javax.swing.GroupLayout.PREFERRED_SIZE, 210, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(BAceptar)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void BAceptarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BAceptarActionPerformed
        // TODO add your handling code here:
        this.setVisible(false);
    }//GEN-LAST:event_BAceptarActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new InterfazReporteMatricula().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton BAceptar;
    private javax.swing.JScrollPane CPEstudiantesMatric;
    private javax.swing.JTable TEstuMatricul;
    private javax.swing.JLabel jLabel1;
    // End of variables declaration//GEN-END:variables
}
